package com.zzty.txj.dao;


import com.zzty.txj.entity.Daily;
import com.zzty.txj.entity.DoDaily;
import com.zzty.txj.entity.User;
import com.zzty.txj.entity.UserDaily;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PostMapper {
    @Select("select * from daily")
    public List<Daily>getDaily();

    @Select("select dailyId from doDaily where userId=#{id}")
    public String getCount(User user);

    @Select("select dailyId from userDaily where userId=#{id} ")
    public String getName(int id);

    @Select("select * from doDaily")
    public List<DoDaily> doDaily();

    @Select("select name from daily where id=#{id}")
    public String getDailyName(int id);

    @Select("select * from userDaily")
    public List<UserDaily>getDailyName1();

    @Select("select * from doDaily where userId=#{id}")
    public List<DoDaily> getDailyByUserId(Integer id);

    @Insert("insert into doDaily(userId,dailyId,date,result) values(#{userId},#{dailyId},#{date},#{result})")
    public Integer count(DoDaily doDaily);
}
